import { useEffect } from 'react';
import Quill from 'quill';
import 'quill/dist/quill.snow.css'; // 主题样式
import 'quill/dist/quill.bubble.css'; // 主题样式
export const Edit = () => {
    useEffect(() => {
        new Quill('#editor', {
          theme: 'snow', // 设置主题
          modules: {
            toolbar: {
              container: [
                [{'header': [1, 2, false]}],
                ['bold', 'italic', 'underline', 'strike', 'blockquote'],
                [{'script': 'sub'}, {'script': 'super'}],
                [{'align': []}],
                [{'color': []}],
                [{'indent': '-1'}, {'indent': '+1'}],
                [{'list': 'ordered'}, {'list': 'bullet'}],
                [{'direction': 'rtl'}],
                ["formula"],
                ['link', 'image', 'video'],
                ['clean'],
              ],
              handlers: {},
            },
          }
        })
      }, [])
      return (
        <div id="editor"></div>
      );
}